/**
 * 设置iframe高度自适应
 * @param {*} iframe 节点信息
 * 
 * 使用方式
 * <script src="/components/assets/js/lee.js"></script>
 * <iframe id="headFrame" src="./components/head/index.html" style="width: 100%;" onload="setIframeHeight(this)"></iframe>
 */
function setIframeHeight(iframe) {
    // var iframe = document.getElementById(id);
    if (iframe) {
        var iframeWin = iframe.contentWindow || iframe.contentDocument.parentWindow;
        if (iframeWin.document.body) {
            iframe.height = iframeWin.document.documentElement.scrollHeight || iframeWin.document.body.scrollHeight;
        }
    }
}